package com.jiayi.weiphoto.activity;

import java.util.ArrayList;

import com.jiayi.weiphoto.entity.ImageEntity;
import com.jiayi.weiphoto.page.SmartImageView;
import com.jiayi.weiphoto.util.SearchSyncImageLoader;
import com.jiayi.weiphoto.util.StringUtil;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;

public class YpImgListAdapter extends BaseAdapter{
	
	ListView parentView;
	Context context;
	ArrayList<ImageEntity> imgList;
	SearchSyncImageLoader imageLoader;
	
	public YpImgListAdapter(Context context, ArrayList<ImageEntity> ypList, ListView listView){
		this.context = context;
		this.imgList = ypList;
		this.parentView = listView;
		imageLoader = SearchSyncImageLoader.getInstance();
		imageLoader.setCacheRootPath(StringUtil.genCompanyRootPath(context));
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return imgList.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return imgList.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int position, View view, ViewGroup vg) {
		// TODO Auto-generated method stub
		ViewHolder holder;
		if(view == null){
			holder = new ViewHolder();
			
		}
		return null;
	}
	
	static class ViewHolder{
		SmartImageView imgView;
	}

}
